<?php
$this->Paginator->options(array(
    'update' => '#content',
    'evalScripts' => true,
    'before' => $this->Js->get('#busy-indicator')->effect('fadeIn', array('buffer' => false)),
    'complete' => $this->Js->get('#busy-indicator')->effect('fadeOut', array('buffer' => false))
));
?>
<div class="awards index">
    <h2><?php __('Awards');?></h2>
    <table cellpadding="0" cellspacing="0">
    <tr>
            <th><?php echo $this->Paginator->sort('member_id');?></th>
            <th><?php echo $this->Paginator->sort('date');?></th>
            <th><?php echo $this->Paginator->sort('category_id');?></th>
            <th><?php echo $this->Paginator->sort('activity_description');?></th>
            <th><?php echo $this->Paginator->sort('status');?></th>
            <th><?php echo $this->Paginator->sort('general');?></th>
            <th><?php echo $this->Paginator->sort('regional');?></th>
            <th><?php echo $this->Paginator->sort('national');?></th>
            <th class="actions"><?php __('Actions');?></th>
    </tr>
    <?php
    $i = 0;
    foreach ($awards as $award):
        $class = null;
        if ($i++ % 2 == 0) {
            $class = ' class="altrow"';
        }
    ?>
    <tr<?php echo $class;?>>
        <td>
            <?php echo $award['Member']['name']; ?>
        </td>
        <td><?php echo date('F, Y', strtotime($award['Award']['date'])); ?></td>
        <td>
            <?php echo $award['Category']['name']; ?>
        </td>
        <td><?php echo $award['Award']['activity_description']; ?>&nbsp;</td>
        <td><?php echo $award['Award']['status']; ?>&nbsp;</td>
        <td><?php echo $award['Award']['general']; ?>&nbsp;</td>
        <td><?php echo $award['Award']['regional']; ?>&nbsp;</td>
        <td><?php echo $award['Award']['national']; ?>&nbsp;</td>
        <td class="actions">
            <?php echo $this->Html->link(__('View', true), array('action' => 'view', $award['Award']['id'])); ?>
            <?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $award['Award']['id'])); ?>
            <?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $award['Award']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $award['Award']['id'])); ?>
        </td>
    </tr>
<?php endforeach; ?>
    </table>
    <p>
    <?php
    echo $this->Paginator->counter(array(
    'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
    ));
    ?>    </p>

    <div class="paging">
        <?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
     |     <?php echo $this->Paginator->numbers();?>
 |
        <?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
    </div>
</div>
<div class="actions">
    <h3><?php __('Actions'); ?></h3>
    <ul>
        <li><?php echo $this->Html->link(__('Request Award', true), array('action' => 'request')); ?></li>
    </ul>
</div>
<?php echo $this->Js->writeBuffer(); ?>